<?php
namespace Admin\Controller;
use Think\Controller;
class GongController extends Controller {
	public function index()
	{
		$Other=M("Other")->where('id=1')->find();
		$this->Other=$Other;
		$this->display("insert");
	}
	public function updateLc()
	{
		$Other=M("Other")->where('id=1')->find();
		$this->Other=$Other;
		$this->display("updatelc");
	}
	public function update()
	{
		  	$other=M("Other");
	  if ($_POST['gongyue']=='gong') {
		$data['gongyue']=$_POST['editorValue'];
	  	}else{
	  		$data['liucheng']=$_POST['editorValue'];
	  	}
	    if (!empty($data)) {
	  		$list=$other->where('id=1')->save($data);
	  		$other->getLastSql();
  		  if ($list) {
	  			    
	  			    echo "<script>
	  			            alert('添加成功');
	  			          </script>";
	  		}else{

	  			    echo "<script>
	  			            alert('失败');
	  			          </script>";
	  		}
	  }
   
	    
	}

}